from pydantic import BaseModel

class McCreditsRechargeBase(BaseModel):
    uniacid: int
    uid: int
    openid: str
    tid: str
    transid: str
    fee: float
    type: str
    tag: str
    status: int
    createtime: int
    backtype: int

class McCreditsRechargeCreate(McCreditsRechargeBase):
    pass

class McCreditsRechargeUpdate(McCreditsRechargeBase):
    pass

class McCreditsRecharge(McCreditsRechargeBase):
    id: int

    class Config:
        orm_mode = True

class McCreditsRecordBase(BaseModel):
    uid: int
    uniacid: int
    credittype: str
    num: float
    operator: int
    module: str
    clerk_id: int
    store_id: int
    clerk_type: int
    createtime: int
    remark: str
    real_uniacid: int

class McCreditsRecordCreate(McCreditsRecordBase):
    pass

class McCreditsRecordUpdate(McCreditsRecordBase):
    pass

class McCreditsRecord(McCreditsRecordBase):
    id: int

    class Config:
        orm_mode = True

class MCFansGroupsBase(BaseModel):
    uniacid: int
    acid: int
    groups: str

class MCFansGroupsCreate(MCFansGroupsBase):
    pass

class MCFansGroupsUpdate(MCFansGroupsBase):
    pass

class MCFansGroups(MCFansGroupsBase):
    id: int

    class Config:
        orm_mode = True

class MCFansTagBase(BaseModel):
    uniacid: int | None = None
    fanid: int
    openid: str
    subscribe: int | None = None
    nickname: str | None = None
    sex: int | None = None
    language: str | None = None
    city: str | None = None
    province: str | None = None
    country: str | None = None
    headimgurl: str | None = None
    subscribe_time: int
    unionid: str | None = None
    remark: str | None = None
    groupid: str | None = None
    tagid_list: str | None = None
    subscribe_scene: str | None = None
    qr_scene_str: str | None = None
    qr_scene: str | None = None

class MCFansTagCreate(MCFansTagBase):
    pass

class MCFansTagUpdate(MCFansTagBase):
    pass

class MCFansTag(MCFansTagBase):
    id: int

    class Config:
        orm_mode = True
class McChatsRecordBase(BaseModel):
    uniacid: int
    acid: int
    flag: int
    openid: str
    msgtype: str
    content: str
    createtime: int

class McChatsRecordCreate(McChatsRecordBase):
    pass

class McChatsRecordUpdate(McChatsRecordBase):
    pass

class McChatsRecord(McChatsRecordBase):
    id: int

    class Config:
        orm_mode = True

class MCFansTagMappingBase(BaseModel):
    fanid: int
    tagid: str

class MCFansTagMappingCreate(MCFansTagMappingBase):
    pass

class MCFansTagMappingUpdate(MCFansTagMappingBase):
    pass

class MCFansTagMapping(MCFansTagMappingBase):
    id: int

    class Config:
        orm_mode = True

class MCGroupsBase(BaseModel):
    uniacid: int
    title: str
    credit: int
    isdefault: int

class MCGroupsCreate(MCGroupsBase):
    pass

class MCGroupsUpdate(MCGroupsBase):
    pass

class MCGroups(MCGroupsBase):
    groupid: int

    class Config:
        orm_mode = True

class MCHandselBase(BaseModel):
    uniacid: int
    touid: int
    fromuid: str
    module: str
    sign: str
    action: str
    credit_value: int
    createtime: int

class MCHandselCreate(MCHandselBase):
    pass

class MCHandselUpdate(MCHandselBase):
    pass

class MCHandsel(MCHandselBase):
    id: int

    class Config:
        orm_mode = True

class McMembersBase(BaseModel):
    uniacid: int
    mobile: str
    email: str
    password: str
    salt: str
    groupid: int
    credit1: float
    credit2: float
    credit3: float
    credit4: float
    credit5: float
    credit6: float
    createtime: int
    realname: str
    nickname: str
    avatar: str
    qq: str
    vip: int
    gender: int
    birthyear: int
    birthmonth: int
    birthday: int
    constellation: str
    zodiac: str
    telephone: str
    idcard: str
    studentid: str
    grade: str
    address: str
    zipcode: str
    nationality: str
    resideprovince: str
    residecity: str
    residedist: str
    graduateschool: str
    company: str
    education: str
    occupation: str
    position: str
    revenue: str
    affectivestatus: str
    lookingfor: str
    bloodtype: str
    height: str
    weight: str
    alipay: str
    msn: str
    taobao: str
    site: str
    bio: str
    interest: str
    pay_password: str
    user_from: int

class McMembersCreate(McMembersBase):
    pass

class McMembersUpdate(McMembersBase):
    pass

class McMembers(McMembersBase):
    uid: int

    class Config:
        orm_mode = True

class McMemberAddressBase(BaseModel):
    uniacid: int
    uid: int
    username: str
    mobile: str
    zipcode: str
    province: str
    city: str
    district: str
    address: str
    isdefault: bool

class McMemberAddressCreate(McMemberAddressBase):
    pass

class McMemberAddressUpdate(McMemberAddressBase):
    pass

class McMemberAddress(McMemberAddressBase):
    id: int

    class Config:
        orm_mode = True

class McMemberFieldsBase(BaseModel):
    uniacid: int
    fieldid: int
    title: str
    available: bool
    displayorder: int

class McMemberFieldsCreate(McMemberFieldsBase):
    pass

class McMemberFieldsUpdate(McMemberFieldsBase):
    pass

class McMemberFields(McMemberFieldsBase):
    id: int

    class Config:
        orm_mode = True

class McMemberPropertyBase(BaseModel):
    uniacid: int
    property: str

class McMemberPropertyCreate(McMemberPropertyBase):
    pass

class McMemberPropertyUpdate(McMemberPropertyBase):
    pass

class McMemberProperty(McMemberPropertyBase):
    id: int

    class Config:
        orm_mode = True

class McOauthFansBase(BaseModel):
    oauth_openid: str
    acid: int
    uid: int
    openid: str

class McOauthFansCreate(McOauthFansBase):
    pass

class McOauthFansUpdate(McOauthFansBase):
    pass

class McOauthFans(McOauthFansBase):
    id: int

    class Config:
        orm_mode = True
